/**
 * 所有版权归 广西梧州 陈锦韬 所有
 *
 * @Title: MybatisConfigBean
 * @Package com.rx.core.bean
 * @Description: mybatis配置或者其他
 * @author: 陈锦韬
 * @date: 2021/6/15
 * @version V1.0
 * @Copyright: 2021 陈锦韬  All rights reserved.
 */
package com.rx.core.bean;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.rx.core.dbase.mutil.MutilTableInsertInterceptor;
import com.rx.core.dbase.mutil.MutilTableInterceptor;
import com.rx.core.interceptor.CustomizedSqlInjector;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: CHENJINTAO170
 * @Description: mybatis配置或者其他
 * @date: 2021/6/15
 */
@Configuration
public class MybatisConfigBean {


    /**
     * 逻辑删除插件
     */
    @Bean
    public ISqlInjector sqlInjector() {
        return new CustomizedSqlInjector();
    }

    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }


    @Bean
    public MutilTableInterceptor doubleInnerInterceptor() {
        return new MutilTableInterceptor();
    }

    @Bean
    public MutilTableInsertInterceptor mutilTableInsertInterceptor() {
        return new MutilTableInsertInterceptor();
    }
}
